import { TaskType } from "js/typeDefine/typeDefine"
import { PartnerModel } from "./partnerModel"

export class TaskModel {
    list: any
    doneAmount: number
    taskList: TaskInfo[]
    refreshTimes: number
    constructor(opts: any = {}) {
        this.list = opts.list || {}
        this.doneAmount = opts.doneAmount || 0
        this.taskList = opts.taskList || []
        this.refreshTimes = opts.refreshTimes || 0
    }
}

export class TaskInfo {
    completeTime: number
    taskId: number
    taskTime: number
    partnerList: string[]
    got: boolean
    reward: any
    type: TaskType
    constructor(opts: any = {}) {
        this.completeTime = opts.completeTime || null
        this.taskId = opts.taskId || null
        this.taskTime = opts.taskTime || 30000
        this.partnerList = opts.taskList || new Array(3)
        this.got = opts.got || false
        this.reward = opts.reward || {}
        this.type = opts.type || null
    }
}